<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            padding: 0;
            margin: 0;
        }
        #demo{
            resize: none;
        }
    </style>
</head>
<body>
    <textarea name="" id="demo" cols="30" rows="10"></textarea>
</body>
<script>
    // 事件对象的属性_键盘事件相关
    // key   按键对应的字符(大写 小写 数字 标点符号 控制键位)
    // code  按键 
    // which/keyCode   在onkeydown onkeyup 返回按键对应键盘码 (一个按键一个码 onkeydown onkeyup 所有的按键均可触发)
    //                 在onkeypress  返回的按键对应的字符的ascll码 (onkeypress文本输入相关按键可触发)
    // var keyCode = e.which || e.keyCode;

    var demo = document.getElementById("demo");

    demo.onkeydown = function (event){
        console.log( event.key , event.which , event.code);
        if(event.ctrlKey && event.which == 13){
            console.log("快捷发送");
        }
    }
    /* demo .onkeypress = function (event){
        // console.log( event.key , event.which , event.code);
        var keyCode = event.which || event.keyCode;
        console.log(event.key , event.which , event.keyCode);

        if( event.which == 10){
            console.log("快捷发送");
        }
    } */
</script>
</html>